Saturday, April 16, 2005

Solving science problems

What is the ideal programming language for MC simulations?

What if we could design a language expressly for MC and QMC simulations - what would it look like? As a first step, let's put programming in the context of solving the whole problem.


Steps to solve a computational science problem


  1. Define the problem (ask the question)
  2. Write down the equations modeling the system under investigation
  3. Using mathematical transformations and approximations, reduce the equations to a solvable form (numerical analysis)
  4. Convert into a computer program and run it
  5. Undertake verification (are steps 2,3, and 4 correct) and validation (are step 1 and the approximations in step 2 correct)


Developing techniques for managing each of the steps would be a great help. Current programming languages only deal with step 4. Computer algebra systems (Mathematica, Maple, Maxima, etc) can help with steps 2 and 3, but don't really help in making the jump to a large scale program.


Currently the transformations from steps 2 through 4 are done by hand. I know I make many mistakes in this process. It would be a boon to my productivity if the computer could verify that all the minus signs and factors of 2 are correct.


The verification step often involves understanding the effects of various approximations in step 3. If the program is described as a series of transformations on the equations, hopefully changing the approximation would be a simple change to the equations, and the rest of the process would automatically generate a correct program. This would make it easier to test approximations.


This doesn't say much about the ideal programming language, but it does give some idea of the problem to be solved. I'll have more to say about the ideal programming language later.

Wednesday, April 13, 2005

Programming Language Notes

On the Sun website, there's an interview with Guy Steele. He talks a little bit about Fortress, which tries to make programs looks more the original problem domain by allowing more mathematical notation. I will be interested to see the results.


Guy Steele is also the principal investigator for the Programming Language Research group. On that page there is a paper titled Object-Oriented Units of Measurement. It's a look the issues involved in making units work in a Java-like OO language.


The last note is an ACM Queue article by Gregory Wilson about Extensible Programming. The article points out that there are advantages to storing the program text in a more structured form, including being able to include diagrams or math notation in the source code.